<?=view('admin.common.header')?>
<style>
    .table>tbody>tr>td {vertical-align: middle;}
</style>
<form id="modifyform" action method="post">
<table class="table">
    <tr>
        <td>一级代理提成(比例)</td>
        <td>
            <input type="text" name="pidpush" class="form-control" value="<?= $pushmoney->pidpush ?>" required="required"/>
        </td>
    </tr>
    <tr>
        <td>二级代理提成(比例)</td>
        <td>
            <input type="text" name="ppidpush" class="form-control" value="<?= $pushmoney->ppidpush ?>" required="required"/>
        </td>
    </tr>
    <tr>
        <td>代付人提成(金额)</td>
        <td>
            <input type="text" name="payagentpush" class="form-control" value="<?= $pushmoney->payagentpush ?>" required="required"/>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <button class="btn btn-primary form-control eveModify">修　改</button>
        </td>
    </tr>
</table>
    <script>
        $('.eveModify').click(function(){
            var pidpush = $('input[name="pidpush"]').val(), ppidpush = $('input[name="ppidpush"]').val(), payagentpush = $('input[name="payagentpush"]').val();
            if (pidpush == '<?= $pushmoney->pidpush ?>' && ppidpush == '<?= $pushmoney->ppidpush ?>' && payagentpush == '<?= $pushmoney->payagentpush ?>') {
                layer.msg('没有任何改动');
                return false;
            }
            if (pidpush == '') {
                layer.msg('一级代理提成不能为空');
                return false;
            }
            if (ppidpush == '') {
                layer.msg('二级代理提成不能为空');
                return false;
            }
            if (payagentpush == '') {
                layer.msg('代付人提成不能为空');
                return false;
            }
            $("#modifyform").ajaxSubmit(function(data){
                layer.msg(data.info);
                if (data.status == 1) {
                    window.parent.location.reload();
                }
            });
            return false;
        })
    </script>
</body>
</html>